package com.huayue.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huayue.dao.BaseDao;
import com.huayue.dao.RoomDao;
import com.huayue.entity.Room;
import com.huayue.util.PageHelper;

/**
 * 房间
 */
@Service
public class RoomService extends BaseService<Room> {

    @Autowired
    RoomDao roomDao;

    @Override
    public BaseDao<Room> getDao() {
        return roomDao;
    }

    public List<Map<String, Object>> findRoom_type(Object... obj) {
        return roomDao.findRoom_type();
    }

    /**
     * 查询room表中所有数据
     * 
     * @return
     */
    public List<Map<String, Object>> find() {
        return roomDao.find();
    }

    /**
     * 查询room表中所有房间数据
     *
     * @return
     */
    public List<Map<String, Object>> findAllRoomAndType() {
        return roomDao.findAllRoomAndType();
    }

    /**
     * 查询在住，脏房，待维修
     * 
     * @return
     */
    public List<Map<String, Object>> findRoom() {
        return roomDao.findRoom();
    }

    /**
     * 查询收入
     * 
     * @param page
     * @param room
     * @param begin
     * @param end
     * @return
     */
    public List<Map<String, Object>> findTotalPriceByRoom(PageHelper page, Room room, String begin, String end) {
        return roomDao.findTotalPriceByRoom(page, room, begin, end);
    }

    /**
     * 查询收入总条数
     * 
     * @param room
     * @param begin
     * @param end
     * @return
     */
    public int findTotalPriceByRoomCount(Room room, String begin, String end) {
        return roomDao.findTotalPriceByRoomCount(room, begin, end);
    }

}
